Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(TLS): Support certificate authority flag #7

Merged
merged 2 commits into from
Feb 29, 2024
Merged

feat(TLS): Support certificate authority flag #7

merged 2 commits into from
Feb 29, 2024

Conversation

jsirianni
Copy link
Member

@jsirianni jsirianni commented Feb 28, 2024

Added new tls_ca_cert option to the action. See the README change for example usage.

I updated CI to generate certificates on each run. The CI action will use the new TLS option to interface with BindPlane. This proves that it is working. Without the TLS option, I was getting errors due to certificate verification failure.

@jsirianni jsirianni changed the title wip: TLS feat(TLS): Support certificate authority flag Feb 28, 2024
Comment on lines +58 to +61
- name: Generate TLS Certs
run: ./.github/workflows/scripts/tls.sh
env:
MAIN_IP: ${{ env.MAIN_IP }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generates the certificates for CI usage. MAIN_IP is required because BindPlane's server certificate is created with IP SANS.

Comment on lines +63 to +69
- name: Set CA certificate
run: |
{
echo 'TLS_CA_CERT<<EOF'
cat step/ca.crt
echo EOF
} >> "$GITHUB_ENV"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was annoying to figure out. This syntax allows us to output a multi line file to an environment variable. This environment variable will be used to configure the new TLS option on the action, similar to using a secret.

-p 3001:3001 \
-v $(pwd)/step/bindplane.crt:/bindplane.crt \
-v $(pwd)/step/bindplane.key:/bindplane.key \
-v $(pwd)/step/ca.crt:/ca.crt \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CA is mounted inside the container despite not being used by the BindPlane server. This allows docker exec to run cli commands within the container, with the --tls-ca flag.

@@ -24,7 +25,7 @@ echo "Current branch is $BRANCH_NAME"
install_bindplane_cli() {
curl -Ls \
-o bindplane.zip \
https://storage.googleapis.com/bindplane-op-releases/bindplane/latest/bindplane-ee-linux-amd64.zip
https://storage.googleapis.com/bindplane-op-releases/bindplane/1.46.0/bindplane-ee-linux-amd64.zip
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding the bindplane version in order to pin it to the action release version. Our BindPlane release process has new instructions for updating this hardcoded version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.46 contains a fix for TLS.

@jsirianni jsirianni marked this pull request as ready for review February 28, 2024 17:08
@jsirianni jsirianni merged commit f60a513 into main Feb 29, 2024
4 checks passed
@jsirianni jsirianni deleted the tls branch February 29, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants